
<%
	//Retrieve necessary session attributes.
	String type = (String) session.getAttribute("type");

	// Retrieve necessary form parameters.
	String file = request.getParameter("file");
	if (file == null) {
		if (session.getAttribute("file") == null) {
			file = "home.jsp";
		} else {
			file = (String) session.getAttribute("file");
		}
	} else if (file.equalsIgnoreCase("null")) {
		file = "home.jsp";
	}

	// Clear variables after they have been read.
	session.setAttribute("file", null);
%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="css/style.css" media="screen" />
<title>Scholar Aide</title>
<script language="javascript" type="text/javascript">
	function redirectClicked(string) {
		var myForm = document.createElement("form");
		myForm.setAttribute('method', "post");
		myForm.setAttribute('action', "dashboard.jsp");
		var data = document.createElement("input");
		data.setAttribute('type', "hidden");
		data.setAttribute('name', "file");
		data.setAttribute('value', string);
		myForm.appendChild(data);
		javascript: myForm.submit();
	}
</script>
</head>
<body>
	<jsp:include page="/includes/header.jsp" />
	<div id="wrapper">
		<div id="content">
			<table id="controls">
				<tr>
					<td><a href="Javascript:void();" onclick="redirectClicked('home.jsp')">Home</a></td>
				</tr>
				<tr>
					<td><a href="Javascript:void();" onclick="redirectClicked('edit_profile.jsp')">Edit Profile</a></td>
				</tr>
				<%
					if (type.equalsIgnoreCase("student")) {
				%>
				<tr>
					<td><a href="Javascript:void();" onclick="redirectClicked('my_applications.jsp')">View My Applications</a></td>
				</tr>
				<%
					} else {
						//	} else if (type.equalsIgnoreCase("reviewer")) {
				%>
				<tr>
					<td><a href="Javascript:void();" onclick="redirectClicked('new_scholarship.jsp')">Create New Scholarship</a></td>
				</tr>
				<tr>
					<td><a href="Javascript:void();" onclick="redirectClicked('list_unfinished_scholarships.jsp')">Finish New Scholarship</a></td>
				</tr>
				<!--<tr>
					<td><a href="Javascript:void();" onclick="redirectClicked('review_applications.jsp')">Review Applications</a></td>
				</tr>-->
				<%
					}
					if (type.equalsIgnoreCase("dean")) {
				%>
				<tr>
					<td><a href="Javascript:void();" onclick="redirectClicked('award_scholarship.jsp')">Award Scholarship</a></td>
				</tr>
				<%
					}
				%>
				<tr>
					<td><a href="logout.jsp">Logout</a></td>
				</tr>
			</table>
			<div>
				<jsp:include page="<%=file%>" />
			</div>
		</div>
	</div>
	<jsp:include page="/includes/footer.jsp" />
</body>
</html>